package com.zmn.mcc.common.dictionary;

import com.google.common.collect.Lists;
import com.zmn.common.dictionary.DictModel;
import com.zmn.mcc.common.constant.StaffFamilyConsts;

import java.util.ArrayList;
import java.util.List;

/**
 * @author quanjic
 * @version v1.0
 * @since 2019/10/15 19:48
 **/
public class StaffFamilyDict {

    /**
     * 描述:关系：1.父母，2.配偶，3.子女，4.其他
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getFamilyList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(4);
        arrayList.add(new DictModel(StaffFamilyConsts.FAMILY_PARENT, StaffFamilyConsts.FAMILY_PARENT_STR));
        arrayList.add(new DictModel(StaffFamilyConsts.FAMILY_SPOUSE, StaffFamilyConsts.FAMILY_SPOUSE_STR));
        arrayList.add(new DictModel(StaffFamilyConsts.FAMILY_CHILDREN, StaffFamilyConsts.FAMILY_CHILDREN_STR));
        arrayList.add(new DictModel(StaffFamilyConsts.FAMILY_OTHER, StaffFamilyConsts.FAMILY_OTHER_STR));
        return arrayList;
    }

    public static String getFamilyName(Integer familyType) {
        switch (familyType) {
            case StaffFamilyConsts.FAMILY_PARENT:
                return StaffFamilyConsts.FAMILY_PARENT_STR;
            case StaffFamilyConsts.FAMILY_SPOUSE:
                return StaffFamilyConsts.FAMILY_SPOUSE_STR;
            case StaffFamilyConsts.FAMILY_CHILDREN:
                return StaffFamilyConsts.FAMILY_CHILDREN_STR;
            case StaffFamilyConsts.FAMILY_OTHER:
                return StaffFamilyConsts.FAMILY_OTHER_STR;
            default:
                return "";
        }
    }

    public static int getFamilyByName(String familyTypeName) {
        switch (familyTypeName) {
            case StaffFamilyConsts.FAMILY_PARENT_STR:
                return StaffFamilyConsts.FAMILY_PARENT;
            case StaffFamilyConsts.FAMILY_SPOUSE_STR:
                return StaffFamilyConsts.FAMILY_SPOUSE;
            case StaffFamilyConsts.FAMILY_CHILDREN_STR:
                return StaffFamilyConsts.FAMILY_CHILDREN;
            case StaffFamilyConsts.FAMILY_OTHER_STR:
                return StaffFamilyConsts.FAMILY_OTHER;
            default:
                return 0;
        }
    }

    /**
     * 描述: 性别：1.男，2.女
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getSexTypeList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(2);
        arrayList.add(new DictModel(StaffFamilyConsts.SEX_TYPE_MAN, StaffFamilyConsts.SEX_TYPE_MAN_STR));
        arrayList.add(new DictModel(StaffFamilyConsts.SEX_TYPE_WOMAN, StaffFamilyConsts.SEX_TYPE_WOMAN_STR));
        return arrayList;
    }

    public static String getSexTypeName(Integer sexType) {
        switch (sexType) {
            case StaffFamilyConsts.SEX_TYPE_MAN:
                return StaffFamilyConsts.SEX_TYPE_MAN_STR;
            case StaffFamilyConsts.SEX_TYPE_WOMAN:
                return StaffFamilyConsts.SEX_TYPE_WOMAN_STR;
            default:
                return "";
        }
    }

    public static int getSexTypeByName(String sexTypeName) {
        switch (sexTypeName) {
            case StaffFamilyConsts.SEX_TYPE_MAN_STR:
                return StaffFamilyConsts.SEX_TYPE_MAN;
            case StaffFamilyConsts.SEX_TYPE_WOMAN_STR:
                return StaffFamilyConsts.SEX_TYPE_WOMAN;
            default:
                return 3;
        }
    }


}
